package config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 */

public class AlipayConfig {

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016101800719346";

	// 商户私钥，您的PKCS8格式RSA2私钥
	public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDMfbTcNEBokFUVjefTb9PSk96p6OgeF6Mm0GTwnhlX+SaxUYOGyRnP1FgfSIQ7ufWHhlpRL50wQW/sMC2IwwGzjdIdKRH20VK8MB1ADmh8dS178fNFHEI0Ehl4O64rRvB2xGUxT3N/znfD0Y6eu1X60M32+Z4TAqCgY4W2VBTYwe8CkfRRCJ03hu2p1jVflESUTaEJ+XpCtO3hmrOPBmxiJSYPy6AAqjuEno2/rwxkF3jjhUdGUkiQ+WLZa4x9yUg2Rc/j1iQRgNtWpEYls6gLWzilugX7EGKDUBm9DZonkZZuoYVwYvlhRWUrDnE4N3qqVyX2UVi7etdPmM6zWc7vAgMBAAECggEAdhESbp2gnn7PEV3YfwSvCYMk6Xc3JcDCC3QBA8hUm62YAIMu7JCJ3awdoRpOdumccL5KwVs7Z5Qwme8LK05kWhZFPV7sJ1Seb1dcXBK1kz5Yn5qHudxiAQx+NiRHIGeaCQjF4F2eMymzjpUcwlspfmI2uSVQdmtq8I/lsOsFCkyN5WhjjInGezjn0OsQLiOEmPK7m2t4RRkMA+R0P21ThQ+xj6amcJ/qvp53VZs3KeUG0mn+WS90yNw/VfSTmnsHy1O/dq5W/UmJMpcvZEnZCJd3EtM8QABODQKuvhNeMUJioMzvEEEUZI9DNw/+2RDUX7Pq42V99UcZFS1SBjpEMQKBgQD1eUnEgB9aPoUe2WZl002uZGlJJaUwMLVkKHU8oaLn8HWJ/9nDi/zfMceIJGSv9AF3RV8m660JUMnEFQ38Ob/ogHd8DiWw2Y/n2LvnhUnvZ0EDtGMN4p/W/RBU7a8L1wkEzjZL3RfbQ/KflqvR544cz76dSajS1Z1Q1767db81JwKBgQDVQobBJXpSGbID5cam8KThGuqqUmIbSi1D6Q51/NnOSzIQjiIxfVPugk/jU0ZS2bG5H1Sst4KZ4tXY7AaFghsY/qPGG6VbW+4esFCc2ISH4QkxnnCcIV3IrrVoufLy33GyCDtTdzcyE0IypOe6Pct2ODp9Rb7ftilPXjbxo7GE+QKBgAlZVTXmq0sElo1WOlAmfA7oRBpFFMWBFWd7IvvsLAgpYFChLeoEqtzVSIQm3q7U3DluqvEQiMaSDR0qsB2rFWQFgId5AnZ50sFBv+ZRbT9w70j01dDxkKTffn+9ja0lw3IraGX7Ra1UKSlq06Bq8T6nqtrSs1tUR2mMzfbVxTKBAoGAEaMK2fZrg1a0rjXWk//a4vMC7Usa6f7cd31SwNdEfBcj8NKQaV9gDZ2hVb+RVVDDrfe1XQNgPbHQ1bvPXkNAUnTcvomSx1d2/fq+7/nIHCS0SfI8he0MgIhSYHLgcM2h7YNYxLJbUjzdgKq6r2Bk70X/MFUQUBgUmofEK3/KMqECgYEA3CCMKu140Fjn1GdGnmxZ4KsJFTPBBjoqPYtu/xZHeA7zAi2wnODz8ejPKJ4zgwMCVHAnw+P7qeP+OTaOKhzm/0Pgm2S2FteitPGnncnfUGaqeziIEEPtfRAGvBqlWV090o9zw3AUk51fd2AKR2f9rOaebDMOSOjb8MnQ1vgcBxU=";

	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
	public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtE9MFFhI1vWzf1n0G4qONWjiLcLliXb2pKemuv2a9viwQwjSG12+GtrdBn1DNjLWwfEwzhIocwhTmpuq1OfjBnGqOoqnO2PAKjGMxqT8gNo70/EIpHbyIeU+za4RQZf+c7WgOSSr8B9B1JkXGR87vD1x5/k5rzEon3/zo07a6ISj6RQ1s43EhFRz+hVLp40XobMnv1HnTxJn62OLJ/0ylCGO4QG+THB7XGs2XDjlsO/uoYjx+6Gu4QA/Tnpslw80B+7FAWiH7ApiDmkYOzALqwNXE1CJs0mJ7lTTmASfEWJydPnSiFgASlcH24kIpErDGQmL+GT1Owlp+eZUw7jBUQIDAQAB+GtrdBn1DNjLWwfEwzhIocwhTmpuq1OfjBnGqOoqnO2PAKjGMxqT8gNo70/EIpHbyIeU+za4RQZf+c7WgOSSr8B9B1JkXGR87vD1x5/k5rzEon3/zo07a6ISj6RQ1s43EhFRz+hVLp40XobMnv1HnTxJn62OLJ/0ylCGO4QG+THB7XGs2XDjlsO/uoYjx+6Gu4QA/Tnpslw80B+7FAWiH7ApiDmkYOzALqwNXE1CJs0mJ7lTTmASfEWJydPnSiFgASlcH24kIpErDGQmL+GT1Owlp+eZUw7jBUQIDAQAB";

	// 服务器异步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://hjl.mynatapp.cc/zfb-pay-demo/aliPayNotifyUrlServlet";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://hjl.mynatapp.cc/zfb-pay-demo/aliPayReturnUrlServlet";

	// 签名方式
	public static String sign_type = "RSA2";

	// 字符编码格式
	public static String charset = "utf-8";

	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

	// 支付宝网关
	public static String log_path = "C:\\";

	// ↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

	/**
	 * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
	 * 
	 * @param sWord 要写入日志里的文本内容
	 */
	public static void logResult(String sWord) {
		FileWriter writer = null;
		try {
			writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
			writer.write(sWord);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (writer != null) {
				try {
					writer.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}
}
